package main;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.ecs.model.v20140526.DescribeInstancesRequest;
import com.aliyuncs.ecs.model.v20140526.DescribeInstancesResponse;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.profile.DefaultProfile;

public class login {


    //阿里云API连接测试
/*    public static void main(String[] args) {
        DefaultProfile profile=DefaultProfile.getProfile(
                "cn-shenzhen",
                "LTAI2GvKYQCbRVvq",
                "TLmGqzXDjUuwdoNxKUGKx9IXtgqznF"
        );

        IAcsClient client=new DefaultAcsClient(profile);

        DescribeInstancesRequest request=new DescribeInstancesRequest();
        request.setPageSize(10);

        DescribeInstancesResponse response;
        try{
            response=client.getAcsResponse(request);
            for (DescribeInstancesResponse.Instance instance:response.getInstances()
                 ) {
                System.out.println(instance.getPublicIpAddress());
            }
        }catch (ServerException e){
            e.printStackTrace();
        } catch (ClientException e) {
            e.printStackTrace();
        }
    }*/

}
